Stacked Area Chart
Shows how the value of multiple categories changes over time. The area of each section represents its contribution to the total value at each point in time. This allows for a clear visualization of the trends and changes in the value of each category over the period. It is particularly useful for understanding the cumulative effect of changes over time.
Chart:
Code:
const { muze, getDataFromSearchQuery } = viz;
const data = getDataFromSearchQuery();
const ColumnField = "Year";
const RowField = "Horsepower";
const ColorField = "Origin";
muze
.canvas()
.rows([RowField])
.columns([ColumnField])
.color(ColorField)
.layers([
{
mark: "area",
transform: {
type: "stack",
},
},
])
.data(data)
.mount("#chart") // mount your chart